package org.example.communication_room.dao;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.util.Set;

// 用户模型
@Getter
@Entity
public class User {
    // Getters and Setters
    @Setter
    @Id
    private Long userId;
    // 用户名唯一
    @Setter
    @Column(unique = true)
    private String username;
    @Setter
    private String password; // 添加密码字段
    @Setter
    private boolean isOnline; // 添加在线状态字段

    @Setter
    @OneToMany(mappedBy = "requester", fetch = FetchType.LAZY)
    private Set<Friendship> sentRequests;  // 用户发起的好友请求

    @OneToMany(mappedBy = "receiver", fetch = FetchType.LAZY)
    private Set<Friendship> receivedRequests;  // 用户收到的好友请求


    public User() {
    }



}